/**
 * 登录api
 */
import http from '../http/http.js'

/**
 * 获取验证码图片
 * @param success 成功回调方法
 * @param error 失败回调方法
 */
export function getCaptchaPic (success, error) {
  http.get('/captcha', '', success, error)
}

export function login (data, success, error) {
  http.post('/loginDeal?captcha=' + data.captcha, data, success, error)
}

export function captcha (data, success, error) {
  http.get('/login/captcha', data, success, error)
}

export function validCaptcha (data, success, error) {
  http.get('/login/captcha/valid?captcha=' + data, null, success, error)
}
